package jiekou.eg2;

public class Test {
    public static void main(String[] args){
        MyMath mm=new MyMath(3,5);
        /**
         * 运用了回调
         *  mm对象调用sum（）方法，sum
         */
        mm.sum(new MyRun() {//匿名实现类
            @Override //重写
            public void show(int s) {
                System.out.println("和为："+s);
            }
        });
        MyMath mm2=new MyMath(17,35);
        mm2.sum(new MyRun() {
            @Override
            public void show(int s) {
                System.out.println("sun is "+s);
            }
        });
    }
}
